Skip to content

fix: skill upload constraints, rejected label, and last-version guard#82

Merged
yun-zhi-ztl merged 22 commits intomainfrom
feature/project-fixbug
Mar 18, 2026
Merged

fix: skill upload constraints, rejected label, and last-version guard#82
yun-zhi-ztl merged 22 commits intomainfrom
feature/project-fixbug

Conversation

@yun-zhi-ztl
Copy link
Collaborator

Changes

1. Relax Skill Upload Constraints

  • Single file size limit: 1MB → 10MB
  • Total extracted package size: 10MB → 100MB
  • Added 21 new allowed file extensions (config, docs, images, languages)
  • Support zip files with a single root directory wrapper (auto-stripped)
  • Refactored SkillPackageArchiveExtractor to use injected SkillPublishProperties
  • Added magic byte validation for new image types (jpeg/gif/webp/ico/pdf)
  • Extended secret scanning and MIME type mapping to new file types

2. Add REJECTED Status Label on My Skills Page

  • resolveStatusLabel and resolveStatusClassName were missing the REJECTED case
  • Added .status-pill--rejected CSS class (red background)
  • Added i18n keys for both en and zh locales

3. Prevent Deleting the Last Remaining Version

  • Backend: SkillGovernanceService.deleteVersion() now checks version count and rejects deletion when only one version remains (error.skill.version.delete.lastVersion)
  • Frontend: hide delete button in skill detail when only one version exists
  • Added error messages in both en and zh locales

Tests

  • SkillPackageValidatorTest: 14 tests passed
  • SkillPackageArchiveExtractorTest: 7 tests passed
  • BasicPrePublishValidatorTest: passed

yun-zhi-ztl and others added 22 commits March 17, 2026 17:34
The resolveStatusLabel and resolveStatusClassName functions were missing
the REJECTED case, causing rejected skills to show raw status string
with no color styling.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Backend: added version count check in SkillGovernanceService.deleteVersion()
Frontend: hide delete button when only one version remains

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix deleteVersion_removesDraftFilesAndBundle: mock findBySkillId to
  return 2 versions so the new guard doesn't block the happy path
- Add deleteVersion_rejectsLastRemainingVersion: verify that deleting
  the only remaining version is rejected with the correct error code
@yun-zhi-ztl yun-zhi-ztl merged commit acbdb82 into main Mar 18, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants